package com.gyh.controller;


import com.gyh.Test1Application;
import com.gyh.entity.User;
import com.gyh.impl.UserServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 * InnoDB free: 11264 kB 前端控制器
 * </p>
 *
 * @author 郭宇航
 * @since 2020-06-07
 */
@Controller
@RequestMapping("/user")
public class UserController {
    private static final Logger logger = LoggerFactory.getLogger(UserController.class);

    @Autowired
    private UserServiceImpl userService;

    @GetMapping("/show")
    public String user(Model model){
        List<User> list = userService.selectList();
        System.out.println(list);
        model.addAttribute("list",list);
        logger.info("info");
        return "/hh";
    }
}

